<template>
	<view class="container">
		<!-- 促销选择时间 -->
		<view class="appointment-time">
			<view class="title">预约时间</view>
			<view class="time">
				<view class="_time">05-24 09:20</view>
				<view class="icon">
					<image src="../../static/logo.png" mode=""></image>
				</view>
			</view>
		</view>
		<!-- 服务项目部分 -->
		<view class="make">
			<view class="make-top">
				<view class="make-top-left">
					服务项目
				</view>
				<view class="make-top-right">
					<view class="text">
						更换
					</view>
					<view class="icon">
						<image src="../../static/logo.png" mode=""></image>
					</view>
				</view>
			</view>
			<view class="card-item">
				<image class="card-image" src="../../static/logo.png" alt="Service Image"></image>
				<view class="card-info">
					<view class="card-header">
						<text class="card-title">按摩 脊柱侧弯 正骨调理</text>
						<view class="badge">鲍医师</view>
					</view>
					<view class="card-subtitle">服务时长：60分钟</view>
					<view class="price-info">
						<view class="current-price">
							<text class="_text">￥</text>
							<text class="__text">598</text>
						</view>
						<view class="original-price">¥7176</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 专业医师部分 -->
		<view class="physician">
			<view class="physician-top">
				预约服务
			</view>
			<view class="card-item">
				<image class="card-image" src="../../static/logo.png" alt="Service Image"></image>
				<view class="card-info">
					<view class="card-header">
						<text class="card-title">鲍医师</text>
						<view class="badge">主任医师</view>
					</view>
					<view class="card-subtitle">服务时长：60分钟</view>
					<view class="price-info">
						擅长：按摩、正骨、腰椎间盘突出
					</view>
				</view>
			</view>
		</view>
		<!-- 底部价格和按钮 -->
		<view class="collect">
			<view class="collect-left">
				<view class="collect-left-number">
					<text class="_text">￥</text>
					<text class="__text">598</text>
				</view>
				<view class="collect-left-money">
					¥7176
				</view>
			</view>
			<view class="collect-right" @click="btnShow">
				下一步
			</view>
		</view>
		<view class="">
			<u-popup :show="show" closeable="true" round="10" mode="bottom" @close="close" @open="open">
				<view class="tab">
					<view class="tab-top">
						选择时间
					</view>
					<view class="tabs">
						<view class="tab-item" :class="{ active: activeTab === index }" v-for="(tab, index) in tabs"
							:key="index" @tap="selectTab(index)">
							<view>{{ tab.day }}</view>
							<view>{{ tab.date }}</view>
						</view>
					</view>
					<view class="content">
						<view class="appointment-item" v-for="(item, index) in appointments[activeTab]" :key="item.time"
							:class="{ booked: item.status === 'booked', full: item.status === 'full' }">
							<view class="time">{{ item.time }}</view>
							<view class="text">{{ item.statusText }}</view>
						</view>
					</view>
					<view class="_collect">
						<view class="collect-left">
							<view class="collect-left-number">
								<text class="_text">￥</text>
								<text class="__text">598</text>
							</view>
							<view class="collect-left-money">
								¥7176
							</view>
						</view>
						<view class="collect-right">
							下一步
						</view>
					</view>
				</view>
			</u-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 其他数据
				activeTab: 0,
				tabs: [{
						day: "今天",
						date: "08-03"
					},
					{
						day: "周五",
						date: "08-04"
					},
					{
						day: "周六",
						date: "08-05"
					},
					{
						day: "周日",
						date: "08-06"
					},
					{
						day: "周一",
						date: "08-07"
					},
				],
				appointments: [
					[{
							time: '12:00',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '12:30',
							status: 'booked',
							statusText: '已预约'
						},
						{
							time: '13:00',
							status: 'full',
							statusText: '已约满'
						},
						{
							time: '13:30',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '14:00',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '14:30',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '15:00',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '15:30',
							status: 'available',
							statusText: '可预约'
						},
					],
					[{
							time: '12:00',
							status: 'available',
							statusText: '可预约'
						},
						{
							time: '12:30',
							status: 'booked',
							statusText: '已预约'
						},
						{
							time: '13:00',
							status: 'full',
							statusText: '已约满'
						},
						{
							time: '13:30',
							status: 'available',
							statusText: '可预约'
						},
					],
					// Add more appointments for other tabs...
				],
				show: false,
				items: [{
						src: '../../static/logo.png'
					},
					{
						src: '../../static/logo.png'
					},
					{
						src: '../../static/logo.png'
					}
				]
			};
		},
		methods: {
			// 其他方法
			btnShow() {
				this.show = true
			},
			selectTab(index) {
				this.activeTab = index;
			},
			open() {
				console.log('open');
			},
			close() {
				this.show = false
				console.log('close');
			}
		},
	};
</script>

<style lang="less" scoped>
	.container {
		background-color: #f5f5f5;
	}

	.tab {
		.tab-top {
			text-align: center;
			font-size: 32rpx;
			margin-top: 20rpx;
			font-weight: 600;
			margin-bottom: 84rpx;
		}

		._collect {
			margin-bottom: 60rpx;
			width: 750rpx;
			display: flex;
			z-index: -1;

			.collect-left {
				width: 376rpx;
				height: 100rpx;
				background: #FFFFFF;
				line-height: 100rpx;
				display: flex;
				line-height: 100rpx;

				.collect-left-number {
					margin-left: 38rpx;

					._text {
						font-size: 24rpx;
						color: #C19C55;
						font-weight: 600;
					}

					.__text {
						font-size: 54rpx;
						color: #C19C55;
						font-weight: 600;
					}
				}

				.collect-left-money {
					height: 28rpx;
					font-family: SourceHanSansCN, SourceHanSansCN;
					font-weight: 400;
					font-size: 28rpx;
					color: #999999;
					line-height: 42rpx;
					text-align: left;
					font-style: normal;
					text-decoration-line: line-through;
					margin-top: 38rpx;
					margin-left: 20rpx;
				}
			}

			.collect-right {
				width: 374rpx;
				height: 100rpx;
				background: #C19C55;
				line-height: 100rpx;
				text-align: center;
				color: #FFFFFF;
				font-size: 32rpx;
			}
		}
	}

	.tabs {
		display: flex;
		justify-content: space-between;
		border-bottom: 2rpx solid #f5f5f5;
	}


	.tab-item.active {
		color: #c7a76c;
		border-bottom: 4rpx solid #c7a76c;
	}

	.tab-item {
		font-size: 24rpx;
		padding: 16rpx 0;
		color: #333;
		text-align: center;
		width: 20%;
	}

	.content {
		display: flex;
		flex-wrap: wrap;
		padding: 46rpx 0;
	}

	.appointment-item {
		width: 140rpx;
		height: 142rpx;
		border: 1rpx solid #eee;
		border-radius: 8rpx;
		text-align: center;
		margin-bottom: 32rpx;
		line-height: 40rpx;
		margin-left: 38rpx;

		.time {
			height: 28rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 400;
			font-size: 28rpx;
			color: #29292B;
			font-style: normal;
			margin-bottom: 30rpx;
			margin-left: 32rpx;
			margin-top: 20rpx;
		}

		.text {
			height: 28rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 400;
			font-size: 22rpx;
			color: #29292B;
			text-align: center;
			font-style: normal;
		}
	}

	.appointment-time {
		display: flex;
		width: 750rpx;
		height: 118rpx;
		background: #FFFFFF;
		line-height: 118rpx;
		margin-bottom: 20rpx;
		padding: 0 28rpx;
		justify-content: space-between;

		.icon {
			width: 22rpx;
			height: 20rpx;
			margin-top: 50rpx;
			margin-left: 10rpx;

			image {
				width: 22rpx;
				height: 20rpx;
			}
		}
	}

	.make {
		width: 750rpx;
		height: 364rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 0 30rpx;
		margin-bottom: 20rpx;

		.make-top {
			height: 116rpx;
			line-height: 116rpx;
			font-size: 30rpx;
			color: #000000;
			border-bottom: 1rpx solid #eee;
			display: flex;
			justify-content: space-between;

			.make-top-left {
				font-weight: 400;
				font-size: 30rpx;
				color: #000000;
			}

			.make-top-right {
				display: flex;

				.text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 30rpx;
					color: #989AA2;
					text-align: right;
					font-style: normal;
				}

				.icon {
					width: 22rpx;
					height: 20rpx;
					margin-top: 50rpx;
					margin-left: 10rpx;

					image {
						width: 22rpx;
						height: 20rpx;
					}
				}
			}
		}

		.card-item {
			display: flex;
			width: 700rpx;
			height: 216rpx;
			background: #F6F7F5;
			border-radius: 20rpx;
			border: 1rpx solid #F2EEEE;
			margin-bottom: 20rpx;
			margin-top: 20rpx;
		}

		.card-image {
			width: 172rpx;
			height: 172rpx;
			border-radius: 15rpx;
			margin-right: 20rpx;
			margin-top: 20rpx;
			margin-left: 22rpx;
		}

		.card-info {
			flex: 1;
		}

		.book {
			position: absolute;
			width: 126rpx;
			height: 58rpx;
			background: #C19C55;
			border-radius: 6rpx;
			font-weight: 400;
			font-size: 28rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 58rpx;
			bottom: 22rpx;
			right: 20rpx;
		}

		.card-header {
			display: flex;
			align-items: center;
			margin-bottom: 10rpx;
		}

		.card-title {
			height: 28rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 500;
			font-size: 28rpx;
			color: #202022;
			line-height: 42rpx;
			text-align: left;
			font-style: normal;
			margin-top: 20rpx;
		}

		.badge {
			height: 34rpx;
			background: linear-gradient(270deg, #FFFFFF 0%, #EAD4B1 100%);
			border-radius: 6rpx;
			font-size: 24rpx;
			color: #9F918B;
			padding-left: 8rpx;
			margin-top: 34rpx;
			margin-left: 10rpx;
		}

		.card-subtitle {
			width: 180rpx;
			height: 22rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 400;
			font-size: 22rpx;
			color: #989AA2;
			line-height: 34rpx;
			text-align: left;
			font-style: normal;
			margin-top: 16rpx;
			margin-bottom: 24rpx;
		}

		.price-info {
			display: flex;
			align-items: baseline;
		}

		.current-price {
			margin-right: 10rpx;

			._text {
				font-size: 24rpx;
				color: #C19C55;
				font-weight: 600;
			}

			.__text {
				font-size: 44rpx;
				color: #C19C55;
				font-weight: 600;
			}
		}

		.original-price {
			font-size: 26rpx;
			color: #ccc;
			text-decoration: line-through;
		}
	}

	.physician {
		width: 750rpx;
		height: 364rpx;
		background: #FFFFFF;
		margin-top: 20rpx;
		padding: 0 30rpx;
		margin-bottom: 20rpx;

		.physician-top {
			height: 114rpx;
			line-height: 114rpx;
			font-size: 30rpx;
			color: #000000;
			border-bottom: 1rpx solid #eee;
		}

		.card-item {
			display: flex;
			width: 700rpx;
			height: 216rpx;
			background: #F6F7F5;
			border-radius: 20rpx;
			border: 1rpx solid #F2EEEE;
			margin-bottom: 20rpx;
			margin-top: 20rpx;
		}

		.card-image {
			width: 172rpx;
			height: 172rpx;
			border-radius: 15rpx;
			margin-right: 20rpx;
			margin-top: 20rpx;
			margin-left: 22rpx;
		}

		.card-info {
			flex: 1;
		}

		.book {
			position: absolute;
			width: 126rpx;
			height: 58rpx;
			background: #C19C55;
			border-radius: 6rpx;
			font-weight: 400;
			font-size: 28rpx;
			color: #FFFFFF;
			text-align: center;
			line-height: 58rpx;
			bottom: 22rpx;
			right: 20rpx;
		}

		.card-header {
			display: flex;
			align-items: center;
			margin-bottom: 10rpx;
		}

		.card-title {
			height: 28rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 500;
			font-size: 28rpx;
			color: #202022;
			line-height: 42rpx;
			text-align: left;
			font-style: normal;
			margin-top: 20rpx;
		}

		.badge {
			width: 98rpx;
			height: 28rpx;
			background: #F7EFE2;
			border-radius: 14rpx 0rpx 14rpx 0rpx;
			font-weight: 500;
			font-size: 18rpx;
			color: #C4A15E;
			padding-left: 16rpx;
			line-height: 28rpx;
			margin-top: 34rpx;
			margin-left: 10rpx;
		}

		.card-subtitle {
			width: 180rpx;
			height: 22rpx;
			font-family: SourceHanSansCN, SourceHanSansCN;
			font-weight: 400;
			font-size: 22rpx;
			color: #989AA2;
			line-height: 34rpx;
			text-align: left;
			font-style: normal;
			margin-top: 16rpx;
			margin-bottom: 34rpx;
		}

		.price-info {
			width: 430rpx;
			height: 34rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #989AA2;
			line-height: 34rpx;
			text-align: left;
			font-style: normal;
		}


	}

	.collect {
		width: 750rpx;
		display: flex;
		position: absolute;
		bottom: 20rpx;

		.collect-left {
			width: 376rpx;
			height: 100rpx;
			background: #FFFFFF;
			line-height: 100rpx;
			display: flex;
			line-height: 100rpx;

			.collect-left-number {
				margin-left: 38rpx;

				._text {
					font-size: 24rpx;
					color: #C19C55;
					font-weight: 600;
				}

				.__text {
					font-size: 54rpx;
					color: #C19C55;
					font-weight: 600;
				}
			}

			.collect-left-money {
				height: 28rpx;
				font-family: SourceHanSansCN, SourceHanSansCN;
				font-weight: 400;
				font-size: 28rpx;
				color: #999999;
				line-height: 42rpx;
				text-align: left;
				font-style: normal;
				text-decoration-line: line-through;
				margin-top: 38rpx;
				margin-left: 20rpx;
			}
		}

		.collect-right {
			width: 374rpx;
			height: 100rpx;
			background: #C19C55;
			line-height: 100rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: 32rpx;
		}
	}

	.title {
		display: flex;
		justify-content: space-between;
		font-size: 32rpx;
		margin-bottom: 20rpx;
	}

	.time {
		display: flex;
		color: #C19C55;
		font-size: 28rpx;
	}
</style>